#! /usr/bin/env python3
import mysql.connector


#连接
mydb = mysql.connector.connect( user='root',
                                password='3567851xy',
                                host='localhost',
                                database='itstar')
print(mydb)

mycursor = mydb.cursor()
 
mycursor.execute("show tables")



#提交并关闭

mydb.close()



